package file;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 张杰
 * Date: 2022-04-19
 * Time: 16:10
 */
//使用字节流,写文件的案例
public class Demo5 {
    public static void main(String[] args) {
       try(OutputStream outputStream = new FileOutputStream("d:/test.txt")) {
          /*outputStream.write(97);
          outputStream.write(98);
          outputStream.write(99);*/
          byte[] buffer = new byte[]{97,98,99};
          outputStream.write(buffer);
       } catch (IOException e) {
           e.printStackTrace();
       }
    }
}
